<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>geosnap.Community &#8212; geosnap v0.3.1 Manual</title>
    <link rel="stylesheet" href="../_static/bootstrap-sphinx.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../_static/pysal-styles.css" />
    <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script src="../_static/jquery.js"></script>
    <script src="../_static/underscore.js"></script>
    <script src="../_static/doctools.js"></script>
    <script src="../_static/language_data.js"></script>
    <link rel="shortcut icon" href="../_static/geosnap.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="geosnap.Community.from_census" href="geosnap.Community.from_census.html" />
    <link rel="prev" title="geosnap.datasets.tracts_2010" href="geosnap.datasets.tracts_2010.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript" src="../_static/js/jquery-1.11.0.min.js "></script>
<script type="text/javascript" src="../_static/js/jquery-fix.js "></script>
<script type="text/javascript" src="../_static/bootstrap-3.3.7/js/bootstrap.min.js "></script>
<script type="text/javascript" src="../_static/bootstrap-sphinx.js "></script>

  </head><body>

  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
    <div class="container">
      <div class="navbar-header">
        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="../index.html"><span><img src="../_static/geosnap.svg"></span>
          geosnap</a>
        <span class="navbar-text navbar-version pull-left"><b>0.3.1</b></span>
      </div>

        <div class="collapse navbar-collapse nav-collapse">
          <ul class="nav navbar-nav">
            
                <li><a href="../installation.html">Installation</a></li>
                <li><a href="../api.html">API</a></li>
                <li><a href="../data.html">Data</a></li>
                <li><a href="https://spatialucr.github.io/geosnap-guide/">User Guide</a></li>
                <li><a href="../references.html">References</a></li>
            
            
              <li class="dropdown globaltoc-container">
  <a role="button"
     id="dLabelGlobalToc"
     data-toggle="dropdown"
     data-target="#"
     href="../index.html">Site <b class="caret"></b></a>
  <ul class="dropdown-menu globaltoc"
      role="menu"
      aria-labelledby="dLabelGlobalToc"><p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../installation.html#installing-a-released-version">Installing a released version</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation.html#installing-development-version">Installing development version</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="reference internal" href="../api.html">API</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../api.html#io-module">IO Module</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../api.html#the-community-class">The Community Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#analyze-module">Analyze Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#harmonize-module">Harmonize Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#visualize-module">Visualize Module</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../references.html">References</a></li>
<li class="toctree-l1"><a class="reference internal" href="../data.html">Data</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../data.html#tabular-data">Tabular Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="../data.html#geo-data">Geo Data</a></li>
</ul>
</li>
</ul>
</ul>
</li>
              
                <li class="dropdown">
  <a role="button"
     id="dLabelLocalToc"
     data-toggle="dropdown"
     data-target="#"
     href="#">Page <b class="caret"></b></a>
  <ul class="dropdown-menu localtoc"
      role="menu"
      aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">geosnap.Community</a></li>
</ul>
</ul>
</li>
              
            
            
            
            
            
          </ul>

          
            
<form class="navbar-form navbar-right" action="../search.html" method="get">
 <div class="form-group">
  <input type="text" name="q" class="form-control" placeholder="Search" />
 </div>
  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>
          
        </div>
    </div>
  </div>

<div class="container">
  <div class="row">
    <div class="body col-md-12 content" role="main">
      
  <div class="section" id="geosnap-community">
<h1>geosnap.Community<a class="headerlink" href="#geosnap-community" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="geosnap.Community">
<em class="property">class </em><code class="sig-prename descclassname">geosnap.</code><code class="sig-name descname">Community</code><span class="sig-paren">(</span><em class="sig-param">gdf=None</em>, <em class="sig-param">harmonized=None</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/geosnap/_community.html#Community"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#geosnap.Community" title="Permalink to this definition">¶</a></dt>
<dd><p>Spatial and tabular data for a collection of “neighborhoods” over time.</p>
<blockquote>
<div><p>A community is a collection of “neighborhoods” represented by spatial
boundaries (e.g. census tracts, or blocks in the US), and tabular data
which describe the composition of each neighborhood (e.g. data from
surveys, sensors, or geocoded misc.). A Community can be large (e.g. a
metropolitan region), or small (e.g. a handfull of census tracts) and
may have data pertaining to multiple discrete points in time.</p>
</div></blockquote>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>gdf</strong><span class="classifier"><a class="reference external" href="https://geopandas.readthedocs.io/en/latest/reference/geopandas.GeoDataFrame.html#geopandas.GeoDataFrame" title="(in GeoPandas v0.7.0+39.g9b17975)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code></a></span></dt><dd><p>long-form geodataframe that holds spatial and tabular data.</p>
</dd>
<dt><strong>harmonized</strong><span class="classifier"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bltin-boolean-values" title="(in Python v3.8)"><span class="xref std std-ref">bool</span></a></span></dt><dd><p>Whether neighborhood boundaries have been harmonized into a set of
time-consistent units</p>
</dd>
<dt><strong>**kwargs</strong></dt><dd></dd>
</dl>
</dd>
<dt class="field-even">Attributes</dt>
<dd class="field-even"><dl>
<dt><strong>gdf</strong><span class="classifier"><a class="reference external" href="https://geopandas.readthedocs.io/en/latest/reference/geopandas.GeoDataFrame.html#geopandas.GeoDataFrame" title="(in GeoPandas v0.7.0+39.g9b17975)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code></a></span></dt><dd><p>long-form geodataframe that stores neighborhood-level attributes
and geometries for one or more time periods</p>
</dd>
<dt><strong>harmonized</strong><span class="classifier"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bltin-boolean-values" title="(in Python v3.8)"><span class="xref std std-ref">bool</span></a></span></dt><dd><p>Whether neighborhood boundaries have been harmonized into
consistent units over time</p>
</dd>
<dt><strong>models</strong><span class="classifier"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><code class="docutils literal notranslate"><span class="pre">dict</span></code></a></span></dt><dd><p>Dictionary of model instances that have been fitted on the community.
The model name is the key and the value is a named tuple that stores the input matrix,
the columns used to fit the model, the cluster labels, and the spatial weights matrix
if necessary. For cluster models, the model name will match a column on the Community.gdf.</p>
</dd>
</dl>
</dd>
</dl>
<dl class="method">
<dt id="geosnap.Community.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">gdf=None</em>, <em class="sig-param">harmonized=None</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/geosnap/_community.html#Community.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#geosnap.Community.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Initialize a new Community.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>gdf</strong><span class="classifier"><a class="reference external" href="https://geopandas.readthedocs.io/en/latest/reference/geopandas.GeoDataFrame.html#geopandas.GeoDataFrame" title="(in GeoPandas v0.7.0+39.g9b17975)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code></a></span></dt><dd><p>long-form geodataframe that stores neighborhood-level attributes
and geometries for one or more time periods</p>
</dd>
<dt><strong>harmonized</strong><span class="classifier"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bltin-boolean-values" title="(in Python v3.8)"><span class="xref std std-ref">bool</span></a></span></dt><dd><p>Whether neighborhood boundaries have been harmonized into
consistent units over time</p>
</dd>
<dt><strong>**kwargs</strong><span class="classifier"><code class="xref py py-obj docutils literal notranslate"><span class="pre">kwargs</span></code></span></dt><dd><p>extra keyword arguments <cite>**kwargs</cite>.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>

<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#geosnap.Community.__init__" title="geosnap.Community.__init__"><code class="xref py py-obj docutils literal notranslate"><span class="pre">__init__</span></code></a>(self[, gdf, harmonized])</p></td>
<td><p>Initialize a new Community.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="geosnap.Community.cluster.html#geosnap.Community.cluster" title="geosnap.Community.cluster"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cluster</span></code></a>(self[, n_clusters, method, …])</p></td>
<td><p>Create a geodemographic typology by running a cluster analysis on the study area’s neighborhood attributes.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="geosnap.Community.cluster_spatial.html#geosnap.Community.cluster_spatial" title="geosnap.Community.cluster_spatial"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cluster_spatial</span></code></a>(self[, n_clusters, …])</p></td>
<td><p>Create a <em>spatial</em> geodemographic typology by running a cluster analysis on the metro area’s neighborhood attributes and including a contiguity constraint.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="geosnap.Community.from_census.html#geosnap.Community.from_census" title="geosnap.Community.from_census"><code class="xref py py-obj docutils literal notranslate"><span class="pre">from_census</span></code></a>([state_fips, county_fips, …])</p></td>
<td><p>Create a new Community from original vintage US Census data.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="geosnap.Community.from_geodataframes.html#geosnap.Community.from_geodataframes" title="geosnap.Community.from_geodataframes"><code class="xref py py-obj docutils literal notranslate"><span class="pre">from_geodataframes</span></code></a>([gdfs])</p></td>
<td><p>Create a new Community from a list of geodataframes.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="geosnap.Community.from_lodes.html#geosnap.Community.from_lodes" title="geosnap.Community.from_lodes"><code class="xref py py-obj docutils literal notranslate"><span class="pre">from_lodes</span></code></a>([state_fips, county_fips, …])</p></td>
<td><p>Create a new Community from Census LEHD/LODES data.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="geosnap.Community.from_ltdb.html#geosnap.Community.from_ltdb" title="geosnap.Community.from_ltdb"><code class="xref py py-obj docutils literal notranslate"><span class="pre">from_ltdb</span></code></a>([state_fips, county_fips, …])</p></td>
<td><p>Create a new Community from LTDB data.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="geosnap.Community.from_ncdb.html#geosnap.Community.from_ncdb" title="geosnap.Community.from_ncdb"><code class="xref py py-obj docutils literal notranslate"><span class="pre">from_ncdb</span></code></a>([state_fips, county_fips, …])</p></td>
<td><p>Create a new Community from NCDB data.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="geosnap.Community.harmonize.html#geosnap.Community.harmonize" title="geosnap.Community.harmonize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">harmonize</span></code></a>(self[, target_year, …])</p></td>
<td><p>Standardize inconsistent boundaries into time-static ones.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="geosnap.Community.sequence.html#geosnap.Community.sequence" title="geosnap.Community.sequence"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sequence</span></code></a>(self, cluster_col[, seq_clusters, …])</p></td>
<td><p>Pairwise sequence analysis to evaluate the distance/dissimilarity between every two neighborhood sequences.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="geosnap.Community.transition.html#geosnap.Community.transition" title="geosnap.Community.transition"><code class="xref py py-obj docutils literal notranslate"><span class="pre">transition</span></code></a>(self, cluster_col[, time_var, …])</p></td>
<td><p>(Spatial) Markov approach to transitional dynamics of neighborhoods.</p></td>
</tr>
</tbody>
</table>
</dd></dl>

</div>


    </div>
      
  </div>
</div>
<footer class="footer">
  <div class="container">
    <p class="pull-right">
      <a href="#">Back to top</a>
      
        <br/>
        
<div id="sourcelink">
  <a href="../_sources/generated/geosnap.Community.rst.txt"
     rel="nofollow">Source</a>
</div>
      
    </p>
    <p>
        &copy; Copyright 2020, geosnap developers.<br/>
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.4.4.<br/>
    </p>
  </div>
</footer>
  </body>
</html>